<?php

class Header extends MY_Controller 
{
	function __construct()
	{
		parent::__construct('header');
	}
	
	function index()
	{
		if($this->uri->segment(2) == 'promotional_email')
		{
			$this->document->addStyle(base_url().'includes/css/promo_email.css');
		}		
		
		$data['title'] = $this->document->getTitle(); 
		
		
		$data['description'] = $this->document->getDescription();
		$data['keywords'] = $this->document->getKeywords();
		$data['links'] = $this->document->getLinks();	
		$data['styles'] = $this->document->getStyles();
		$data['scripts'] = $this->document->getScripts();
		$data['lang'] = $this->lang->line('code');
		$data['direction'] = $this->lang->line('direction');
				
		$this->load->language('partial/header');

		$data['heading_title'] = $this->lang->line('heading_title');
		
		$data['text_affiliate'] = $this->lang->line('text_affiliate');
		$data['text_attribute'] = $this->lang->line('text_attribute');
		$data['text_attribute_group'] = $this->lang->line('text_attribute_group');
		$data['text_backup'] = $this->lang->line('text_backup');
		$data['text_banner'] = $this->lang->line('text_banner');
		$data['text_catalog'] = $this->lang->line('text_catalog');
		$data['text_category'] = $this->lang->line('text_category');
		$data['text_confirm'] = $this->lang->line('text_confirm');
		$data['text_country'] = $this->lang->line('text_country');
		$data['text_coupon'] = $this->lang->line('text_coupon');
		$data['text_currency'] = $this->lang->line('text_currency');			
		$data['text_customer'] = $this->lang->line('text_customer');
		$data['text_customer_group'] = $this->lang->line('text_customer_group');
		$data['text_sale'] = $this->lang->line('text_sale');
		$data['text_design'] = $this->lang->line('text_design');
		$data['text_documentation'] = $this->lang->line('text_documentation');
		$data['text_download'] = $this->lang->line('text_download');
		$data['text_error_log'] = $this->lang->line('text_error_log');
		$data['text_extension'] = $this->lang->line('text_extension');
		$data['text_feed'] = $this->lang->line('text_feed');
		$data['text_front'] = $this->lang->line('text_front');
		$data['text_geo_zone'] = $this->lang->line('text_geo_zone');
		$data['text_dashboard'] = $this->lang->line('text_dashboard');
		$data['text_help'] = $this->lang->line('text_help');
		$data['text_information'] = $this->lang->line('text_information');
		$data['text_language'] = $this->lang->line('text_language');
		$data['text_layout'] = $this->lang->line('text_layout');
      	$data['text_localisation'] = $this->lang->line('text_localisation');
		$data['text_logout'] = $this->lang->line('text_logout');
		$data['text_contact'] = $this->lang->line('text_contact');
		$data['text_manufacturer'] = $this->lang->line('text_manufacturer');
		$data['text_module'] = $this->lang->line('text_module');
		$data['text_newsletter'] = $this->lang->line('text_newsletter');
		$data['text_promotional_email'] = $this->lang->line('text_promotional_email');
		$data['text_option'] = $this->lang->line('text_option');
		$data['text_order'] = $this->lang->line('text_order');
		$data['text_order_status'] = $this->lang->line('text_order_status');
		$data['text_opencart'] = $this->lang->line('text_opencart');
		$data['text_payment'] = $this->lang->line('text_payment');
		$data['text_product'] = $this->lang->line('text_product'); 
		$data['text_addproducts'] = $this->lang->line('text_addproducts');
		$data['text_reports'] = $this->lang->line('text_reports');
		$data['text_report_purchased'] = $this->lang->line('text_report_purchased');     		
		$data['text_report_sale'] = $this->lang->line('text_report_sale');
		$data['text_report_sale_order'] = $this->lang->line('text_report_sale_order');
		$data['text_report_sale_tax'] = $this->lang->line('text_report_sale_tax');
		$data['text_report_sale_return'] = $this->lang->line('text_report_sale_return');
		$data['text_report_sale_shipping'] = $this->lang->line('text_report_sale_shipping');
		$data['text_report_sale_coupon'] = $this->lang->line('text_report_sale_coupon');
     	$data['text_report_product_viewed'] = $this->lang->line('text_report_product_viewed');
		$data['text_report_product'] = $this->lang->line('text_report_product');
		$data['text_report_product_purchased'] = $this->lang->line('text_report_product_purchased');
		$data['text_report_customer'] = $this->lang->line('text_report_customer');
		$data['text_report_customer_order'] = $this->lang->line('text_report_customer_order');
		$data['text_report_customer_reward'] = $this->lang->line('text_report_customer_reward');
		$data['text_report_customer_credit'] = $this->lang->line('text_report_customer_credit');
		$data['text_review'] = $this->lang->line('text_review');
		$data['text_return'] = $this->lang->line('text_return');
		$data['text_newss'] = $this->lang->line('text_newss');
		$data['text_news'] = $this->lang->line('text_news');
		$data['text_news_group'] = $this->lang->line('text_news_group');

		$data['text_return_action'] = $this->lang->line('text_return_action');
		$data['text_return_reason'] = $this->lang->line('text_return_reason');
		$data['text_return_status'] = $this->lang->line('text_return_status');
		$data['text_support'] = $this->lang->line('text_support'); 
		$data['text_shipping'] = $this->lang->line('text_shipping');		
     	$data['text_setting'] = $this->lang->line('text_setting');
		$data['text_stock_status'] = $this->lang->line('text_stock_status');
		$data['text_system'] = $this->lang->line('text_system');
		$data['text_tax_class'] = $this->lang->line('text_tax_class');
		$data['text_total'] = $this->lang->line('text_total');
		$data['text_user'] = $this->lang->line('text_user');
		$data['text_user_group'] = $this->lang->line('text_user_group');
		$data['text_users'] = $this->lang->line('text_users');
		$data['text_voucher'] = $this->lang->line('text_voucher');
		$data['text_voucher_theme'] = $this->lang->line('text_voucher_theme');
      	$data['text_weight_class'] = $this->lang->line('text_weight_class');
		$data['text_length_class'] = $this->lang->line('text_length_class');
      	$data['text_zone'] = $this->lang->line('text_zone');
		
		$data['text_brancharea'] = $this->lang->line('text_brancharea');
		$data['text_branch_group'] = $this->lang->line('text_branch_group');
		$data['text_branch'] = $this->lang->line('text_branch');
		
		$this->load->model('user/Model_User');
		if($this->Model_User->is_logged_in())
		{
						
			$data['logged'] = sprintf($this->lang->line('text_logged'), $this->session->userdata('username'));

			$data['home'] = site_url().'/user/home';
			
			
			$data['affiliate'] = site_url().'/sale/affiliate';
			$data['attribute'] = site_url().'/catalog/attribute';
			$data['attribute_group'] = site_url().'/catalog/attribute_group';
			$data['backup'] = site_url().'/tool/backup';
			$data['banner'] = site_url().'/design/banner';
			$data['category'] = site_url().'/catalog/category';
			$data['country'] = site_url().'/localisation/country';
			$data['coupon'] = site_url().'/sale/coupon';
			$data['currency'] = site_url().'/localisation/currency';
			$data['customer'] = site_url().'/sale/customer';
			$data['customer_group'] = site_url().'/sale/customer_group';
			$data['download'] = site_url().'/catalog/download';
			$data['error_log'] = site_url().'/tool/error_log';
			$data['feed'] = site_url().'/extension/feed';			
			
			$data['stores'] = array();
			/*
			$this->load->model('setting/store');
			
			$results = $this->model_setting_store->getStores();
			
			foreach ($results as $result) {
				$data['stores'][] = array(
					'name' => $result['name'],
					'href' => $result['url']
				);
			}
			*/
			$data['geo_zone'] = site_url().'/localisation/geo_zone';
			$data['information'] = site_url().'/catalog/information';
			$data['language'] = site_url().'/localisation/language';
			$data['layout'] = site_url().'/design/layout';
			$data['logout'] = site_url().'/user/home/logout';
			$data['contact'] = site_url().'/sale/contact';
			$data['manufacturer'] = site_url().'/catalog/manufacturer';
			$data['module'] = site_url().'/extension/module';
			$data['newsletter'] = site_url().'/sale/newsletter';
			$data['promotional_email'] = site_url('/sale/promotional_email');
			$data['option'] = site_url().'/catalog/option';
			$data['order'] = site_url().'/sale/order';
			$data['order_status'] = site_url().'/localisation/order_status';
			$data['payment'] = site_url().'/extension/payment';
			$data['product'] = site_url().'/catalog/product';
			$data['addproducts'] = site_url().'/tool/export';
			$data['report_purchased'] = site_url().'/report/purchased';
			$data['report_sale'] = site_url().'/report/sale';
			$data['report_tax'] = site_url().'/report/tax';
			$data['report_coupon'] = site_url().'/report/coupon';
			$data['report_sale_return'] = site_url().'/report/sale_return';
			$data['report_shipping'] = site_url().'/report/shipping';
			$data['report_viewed'] = site_url().'/report/viewed';
			$data['report_product_viewed'] = site_url().'/report/product_viewed';
			$data['report_product_purchased'] = site_url().'/report/product_purchased';
			$data['report_customer_order'] = site_url().'/report/customer_order';
			$data['report_customer_credit'] = site_url().'/report/customer_credit';
			$data['report_customer_reward'] = site_url().'/report/customer_reward';
			$data['review'] = site_url().'/catalog/review';
			$data['return'] = site_url().'/sale/salereturn';
			$data['return_action'] = site_url().'/localisation/return_action';
			$data['return_reason'] = site_url().'/localisation/return_reason';
			$data['return_status'] = site_url().'/localisation/return_status';			
			$data['shipping'] = site_url().'/extension/shipping';
			$data['setting'] = site_url().'/setting/store';
			//$data['store'] = $this->config->item('front_url');
			$data['stock_status'] = site_url().'/localisation/stock_status';
			$data['tax_class'] = site_url().'/localisation/tax_class';
			$data['total'] = site_url().'/extension/total';
			$data['user'] = site_url().'/user/user';
			$data['user_group'] = site_url().'/user/user_permission';
			$data['voucher'] = site_url().'/sale/voucher';
			$data['voucher_theme'] = site_url().'/sale/voucher_theme';
			$data['weight_class'] = site_url().'/localisation/weight_class';
			$data['length_class'] = site_url().'/localisation/length_class';
			$data['zone'] = site_url().'/localisation/zone';
			$data['report_sale'] = site_url().'/report/sale';
			$data['news'] = site_url().'/sale/news';
			$data['news_group'] = site_url().'/sale/news_group';
			
			$data['brancharea'] = site_url().'/localisation/brancharea';
			$data['branch_group'] = site_url().'/localisation/branch_group';
			$data['branch'] = site_url().'/localisation/branch';
		
		}
		else
		{
			$data['logged'] = '';
			
			$data['home'] = site_url().'/user/login';
		}
		
		
	
	return $this->load->view('partial/header', $data, true);
}
	
}




?>